CC=./wrapper.exe
VIA=-via

all: indent
	g++ -g -pg wrapper.cpp -o wrapper -D__DEBUG__

clean:
	rm -rf wrapper.exe
	rm -rf result?.txt
	rm -rf *.out
	rm -rf wrapper.cpp~
	rm -rf ./release

test: all
	#$(CC) -E -DGEN_FOR_CPARSER -DGEN_FOR_PC $(VIA) make\gb_wrapper.via

	echo "\n\n\n***************************ayan*****************************\n\n\n"
	$(CC) -E -DGEN_FOR_CPARSER -DGEN_FOR_PC $(VIA) make\gb_wrapper.via > result1.txt

	echo "\n\n\n***************************ayan*****************************\n\n\n"
	$(CC) -E -DGEN_FOR_CPARSER -DGEN_FOR_PC $(VIA) make\gb_wrapper.via $(VIA) make\gb_vk_get_cand.via -END_AYAN -TEST_AYAN__ -TEST_PARASOFT_SHANGHAI_AYAN__ > result2.txt
	#$(CC) -E -DGEN_FOR_CPARSER -DGEN_FOR_PC $(VIA) make\gb_wrapper.via -END_AYAN -TEST_AYAN__ -TEST_PARASOFT_SHANGHAI_AYAN__ > result2.txt
	#wrapper.exe -E -DGEN_FOR_CPARSER -DGEN_FOR_PC -via make\gb_wrapper.via -via make\gb_vk_get_cand.via -END_AYAN -TEST_AYAN__ -TEST_PARASOFT_SHANGHAI_AYAN__ > result2.txt

	echo "\n\n\n***************************ayan*****************************\n\n\n"

indent:
	indent -npro -kr -i8 -ts8 -sob -l120 -ss -ncs -cp1 wrapper.cpp
	indent -bad -bap -bbb -bbo -nbc -bl -bli0 -bls -c33 -cd33 -ncdb -ncdw -nce -cli0 -cp33 -cs -d0 -nbfda -di2 -nfc1 -nfca -hnl -ip5 -l75 -lp -pcs -nprs -psl -saf -sai -saw -nsc -nsob -nss -i4 -ts4 -ut *.cpp
	indent -bad -bap -bbb -bbo -nbc -bl -bli0 -bls -c33 -cd33 -ncdb -ncdw -nce -cli0 -cp33 -cs -d0 -nbfda -di2 -nfc1 -nfca -hnl -ip5 -l75 -lp -pcs -nprs -psl -saf -sai -saw -nsc -nsob -nss -i4 -ts4 -ut *.c
	rm -rf *~
	#http://www.cppblog.com/schindlerlee/archive/2009/02/27/indent.html
	#http://www.worldhello.net/doc/program_rules/indent.html
release: indent clean
	mkdir ./release/
	cp -r ./make ./release/
	cp cpptest.cfg ./release/
	g++ -O2 wrapper.cpp -o ./release/wrapper 
	# -D__DEBUG__

